package net.sk.china.platform;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a>)
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/2 11:40
 * +----------------------------------------------------------------------
 */
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) // 去除自带的数据
@ComponentScan(basePackages = {
        "net.sk.china.platform.config",
        "net.sk.china.platform.web",
        "net.sk.china.platform.task",
        "net.sk.china.platform.service.impl",
        "net.sk.china.common.exception",
        "net.sk.china.common.config"
}, excludeFilters = {
        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {
                // 去除指定的类
        })
}, basePackageClasses = {
        net.sk.china.common.utils.RedisUtil.class,
        net.sk.china.common.utils.RestTemplateUtil.class,
        net.sk.china.platform.utils.ProductUtils.class,
        net.sk.china.platform.token.TokenComponent.class,
        net.sk.china.platform.manager.CustomAuthenticationProvider.class,
        net.sk.china.platform.manager.CustomAuthenticationManager.class
})  // 扫描项目需要用到的包
@MapperScan(basePackages = {"net.sk.china.platform.dao"})   // 指定要变成实体类接口所在的包
@EnableTransactionManagement  // 开启事务支持
@EnableAsync  //开启异步调用

public class PlatformApplication {

    public static void main(String[] args) { SpringApplication.run(PlatformApplication.class, args); }
}
